{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "#hand-writing digits\n",
    "from sklearn import datasets\n",
    "import matplotlib.pyplot as plt\n",
    "digits = datasets.load_digits()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABQAAAANOCAYAAABOZqHRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8GearUAAAgAElEQVR4nOzde7hlZ10f8O8vhDsmMwm3aoRkgMpFJISkgKAEnViJLRPERCkIE1SwCBIs7aRP+9iExyrR2gartRSlEw0IhJakVIQywKRSEMxA4gWxGBLQYhDMJCFAwiVv/9j7OGsOc2bOZe+zznnn83me/Txrr70uv3My55e9v3ut963WWgAAAACAPh0zdgEAAAAAwPwIAAEAAACgYwJAAAAAAOiYABAAAAAAOiYABAAAAICOCQABAAAAoGMCQAAAAADomAAQAAAAADomAAQAAACAjgkAAQAAAKBjAkAAAAAA6JgAEAAAAAA6JgAEAAAAgI4JAAEAAACgYwJAAAAAAOiYABAAAAAAOiYABAAAAICOCQABAAAAoGMCQAAAAADomADwKFZVJ1dVmz5uXOdz7x6ce+d6nhtgSC8E0AsBFuiH9OrYsQtgaVW1N8nTlnj5ziS3JrktyWeTfDTJviTvba19el0K7ExV3T/JziQ/mOSUJFsz+d3+aZLfSfKm1tpXRysQjlJ64fqoqvskeXySM6aP05M8IklNN7m4tXbRONUBeuH6qKrTkmxP8p1JHpPkwUnumeSWJH+R5H8n+c3W2idGKxKOcvrh/FXVtiRPTXJakm9PcnKSByW5d5IvJflckmuT/G6St7TWbh+nUlZCALh53TPJA6ePhyd5ynT9XVX1ziS/0lp711jFzcL0G4//On16WWtt5xzP9Y+S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AAAAAxQRAAAAAACgmAAIAAABAMQEQAAAAAIoJgAAAAABQTAAEAAAAgGICIAAAAAAUEwABAAAAoJgACAAAAADFBEAAAAAAKCYAAgAAAEAxARAAAAAAigmAAAAAAFBMAAQAAACAYgIgAAAAABQTAAEAAACgmAAIAAAAAMUEQAAAAAAoJgACAAAAQDEBEAAAAACKCYAAAAAAUEwABAAAAIBiAiAAAAAAFBMAAQAAAKCYAAgAAAAAxR6NHsDd293dHT0hSfL8+fPRE5IkR0dHoyfAg/Lee++NnpAkefLkyegJi3J4eDh6Qlar1egJcK+Wch9kvV6PnpAkOT8/Hz0hyTLOooODg9ET4N5cX1+PnpAkubi4GD0hyXIer9PPFYAAAAAAUEwABAAAAIBiAiAAAAAAFBMAAQAAAKCYAAgAAAAAxQRAAAAAACgmAAIAAABAMQEQAAAAAIoJgAAAAABQTAAEAAAAgGICIAAAAAAUEwABAAAAoJgACAAAAADFBEAAAAAAKCYAAgAAAEAxARAAAAAAigmAAAAAAFBMAAQAAACAYgIgAAAAABQTAAEAAACgmAAIAAAAAMUEQAAAAAAoJgACAAAAQDEBEAAAAACKCYAAAAAAUEwABAAAAIBiAiAAAAAAFBMAAQAAAKCYAAgAAAAAxQRAAAAAACgmAAIAAABAMQEQAAAAAIoJgAAAAABQbJrnefQGAAAAAOCOuAIQAAAAAIoJgAAAAABQTAAEAAAAgGICIAAAAAAUEwABAAAAoJgACAAAAADFBEAAAAAAKCYAAgAAAEAxARAAAAAAigmAAAAAAFBMAAQAAACAYgIgAAAAABQTAAEAAACgmAAIAAAAAMUEQAAAAAAoJgACAAAAQDEBEAAAAACKCYAAAAAAUEwABAAAAIBi3weJ335SANOkHgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1600x1200 with 8 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#show images\n",
    "images_and_labels = list(zip(digits.images,digits.target))\n",
    "plt.figure(figsize=(8,6),dpi=200)\n",
    "for index,(image,label) in enumerate(images_and_labels[:8]):\n",
    "    plt.subplot(2,4,index+1)\n",
    "    plt.axis('off')\n",
    "    plt.imshow(image,cmap=plt.cm.gray_r,interpolation='nearest')\n",
    "    plt.title('Digit:%i' % label)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([[ 0.,  0.,  0., 12., 13.,  5.,  0.,  0.],\n",
       "        [ 0.,  0.,  0., 11., 16.,  9.,  0.,  0.],\n",
       "        [ 0.,  0.,  3., 15., 16.,  6.,  0.,  0.],\n",
       "        [ 0.,  7., 15., 16., 16.,  2.,  0.,  0.],\n",
       "        [ 0.,  0.,  1., 16., 16.,  3.,  0.,  0.],\n",
       "        [ 0.,  0.,  1., 16., 16.,  6.,  0.,  0.],\n",
       "        [ 0.,  0.,  1., 16., 16.,  6.,  0.,  0.],\n",
       "        [ 0.,  0.,  0., 11., 16., 10.,  0.,  0.]]),\n",
       " 1)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "images_and_labels[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.,  0.,  0., 12., 13.,  5.,  0.,  0.],\n",
       "       [ 0.,  0.,  0., 11., 16.,  9.,  0.,  0.],\n",
       "       [ 0.,  0.,  3., 15., 16.,  6.,  0.,  0.],\n",
       "       [ 0.,  7., 15., 16., 16.,  2.,  0.,  0.],\n",
       "       [ 0.,  0.,  1., 16., 16.,  3.,  0.,  0.],\n",
       "       [ 0.,  0.,  1., 16., 16.,  6.,  0.,  0.],\n",
       "       [ 0.,  0.,  1., 16., 16.,  6.,  0.,  0.],\n",
       "       [ 0.,  0.,  0., 11., 16., 10.,  0.,  0.]])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "digits.images[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3, 4, 5, 6, 7, 8])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "digits.target[1:9]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.,  0.,  0., 12., 13.,  5.,  0.,  0.,  0.,  0.,  0., 11., 16.,\n",
       "         9.,  0.,  0.,  0.,  0.,  3., 15., 16.,  6.,  0.,  0.,  0.,  7.,\n",
       "        15., 16., 16.,  2.,  0.,  0.,  0.,  0.,  1., 16., 16.,  3.,  0.,\n",
       "         0.,  0.,  0.,  1., 16., 16.,  6.,  0.,  0.,  0.,  0.,  1., 16.,\n",
       "        16.,  6.,  0.,  0.,  0.,  0.,  0., 11., 16., 10.,  0.,  0.],\n",
       "       [ 0.,  0.,  0.,  4., 15., 12.,  0.,  0.,  0.,  0.,  3., 16., 15.,\n",
       "        14.,  0.,  0.,  0.,  0.,  8., 13.,  8., 16.,  0.,  0.,  0.,  0.,\n",
       "         1.,  6., 15., 11.,  0.,  0.,  0.,  1.,  8., 13., 15.,  1.,  0.,\n",
       "         0.,  0.,  9., 16., 16.,  5.,  0.,  0.,  0.,  0.,  3., 13., 16.,\n",
       "        16., 11.,  5.,  0.,  0.,  0.,  0.,  3., 11., 16.,  9.,  0.]])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "digits.data[1:3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "shape of raw image data:(1797, 8, 8)\n",
      "shape of data :(1797, 64)\n"
     ]
    }
   ],
   "source": [
    "print(\"shape of raw image data:{0}\".format(digits.images.shape))\n",
    "print(\"shape of data :{0}\".format(digits.data.shape))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#split train and test\n",
    "from sklearn.model_selection import train_test_split\n",
    "x_train,x_test,y_train,y_test = train_test_split(digits.data,digits.target,test_size=0.20,random_state=2);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "#svm train\n",
    "from sklearn import svm\n",
    "clf = svm.SVC(gamma=0.001,C=100)\n",
    "clf.fit(x_train,y_train);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9777777777777777"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clf.score(x_test,y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAc0AAAHECAYAAABbSnHVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8GearUAAAgAElEQVR4nO3de1xU1d4/8M+AAiIIhAiICnhBS0wUSvOoYBpZehLNY+exTLxkPz31aNmxp+wV2E17kMTT8ckyFS1LK1NOeTlHj2B5IQUFIRHlKCihBAgKyIDI/P4Y3Q5xW2s3N+Dzfr18vfaeWWv28rtm5svsy3drdDodiIiIqGU2lh4AERFRa8GkSUREJIhJk4iISBCTJhERkSAmTSIiIkEdZBp37dpV5+fnZ6KhqHfjxg3pPllZWdJ97r33Xqn2jo6O0tuQlZubi+LiYo1MH3PM461bt6T7ZGRkSPdxcnKS7uPv7y/V3tbWVnobsqx1HgsKCqT7lJWVSfdR837p2bOnVHtXV1fpbciy1nmsqamR7qPm89ipU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l0ZNmgAwyncUdk3fhZk7ZyL/ej6uVFzBRykfNWjn0MEBK8auwMLhC409hFZlxIgR2LZtG+bPn4+CggJcuXIFH33USLwcHLBixQosXGi+eG3P2t7s841dOB3Yrf3eucaQ4ckFAJTj0Ybc3d3NNRycKT6DM8VnmnzesYMj/mf4/+CFoS+YbUzW6syZMw0KthtydHTEsmXLsHjxYjOOSq/FeezoiGVhy7D4IfOPzRqZYi6NnjQBfWGD0wtOIz4tHjvO7EB2STaKKovgbO+M3m69Ed47HAseWACfLj6m2HyrM3r0aCQnJ+PLL7/E3r17kZ2djaKiIjg7O6N3794IDw/HggUL4OPDeJG4hcMWIqR7CJLzk3G84Djyr+ejqKIIZdVlcOjgADcHNwR2DcTonqPx1ICn4Opg2evlLGnhwoUICQlBcnIyjh8/jvz8fBQXF6O0tBQODg5wd3fH4MGD8fDDD2PGjBlwc3Mz39gamcfiG8UorSqFQwcHuDu6Y7DnYDzs/zBm3D8Dbp3MNzZrZOq5NEnSBABne2e8OOxFvDjsRVNtok1xdnbGvHnzsGTJEksPRaGL0ll6CK2WOfcINMWtkxsmBkzExICJymPNFTdoz9zc3DBx4kRMnDix5cZm1tg8UtNMPZe8MSMREZEgJk0iIiJBTJpERESCNDqd+HErjUZTBCDPdMMhFXx1Op1Hy83u4jxaJc5j28B5bBuanEeppElERNSecfcsERGRICZNIiIiQUyaREREgpg0iYiIBDFpEhERCWLSJCIiEsSkSUREJIhJk4iISBCTJhERkaD/D62/oiOoyvmJAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 576x576 with 16 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "Ypred = clf.predict(x_test) #执行预测\n",
    "#预测和真实值的对比\n",
    "fig,axes=plt.subplots(4,4,figsize=(8,8))\n",
    "fig.subplots_adjust(hspace=0.1,wspace=0.1)\n",
    "for i,ax in enumerate(axes.flat):\n",
    "    ax.imshow(x_test[i].reshape(8,8),cmap=plt.cm.gray_r,interpolation='nearest')\n",
    "    ax.text(0.05,0.05,str(Ypred[i]),fontsize=32,transform=ax.transAxes,color='green' if Ypred[i]==y_test[i] else 'red' )\n",
    "    ax.text(0.8,0.05,str(y_test[i]),fontsize=32,transform=ax.transAxes,color='black')\n",
    "    ax.set_xticks([])\n",
    "    ax.set_yticks([])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/sklearn/externals/joblib/__init__.py:15: FutureWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.\n",
      "  warnings.warn(msg, category=FutureWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "['/Users/elvis/dhcc/python/digits_svm.pkl']"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#save model\n",
    "from sklearn.externals import joblib\n",
    "joblib.dump(clf,'/Users/elvis/dhcc/python/digits_svm.pkl')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.0"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#import model \n",
    "clf2 = joblib.load('/Users/elvis/dhcc/python/digits_svm.pkl')\n",
    "yp = clf2.predict(x_test)\n",
    "clf2.score(x_test,yp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
